using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;

public enum RuleTileTag {
	OnlySelf,
	Solid,
	Solid2,
	Solid3,
	Solid4,
	Solid5,
	Ground,
	Ground2,
	Ground3,
	Ground4,
	Ground5
}

[CreateAssetMenu(fileName = "TagRuleTile",menuName = "Custom/TagRuleTile")]
public class TagRuleTile:RuleTile<TagRuleTile.Neighbor> {

	public class Neighbor:TilingRuleOutput.Neighbor {
	}

	public RuleTileTag tag;

	public override bool RuleMatch(int neighbor,TileBase tile) {
		if(tag==RuleTileTag.OnlySelf) return base.RuleMatch(neighbor,tile);
		if(tile is TagRuleTile) {
			TagRuleTile ruleTile = tile as TagRuleTile;
			switch(neighbor) {
			case Neighbor.This:return ruleTile.tag==tag;
			case Neighbor.NotThis:return ruleTile.tag!=tag;
			}
		}
		return base.RuleMatch(neighbor,tile);
	}
}